package logic

import (
	"context"
	"wet/model/cache"

	"wet/wetrpc/internal/svc"
	"wet/wetrpc/wetrpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type ShopClearLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewShopClearLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ShopClearLogic {
	return &ShopClearLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 购物车清除
func (l *ShopClearLogic) ShopClear(in *wetrpc.ShopClearRequest) (*wetrpc.ShopClearResponse, error) {
	// todo: add your logic here and delete this line

	cache.ShopClear(in.UserId)
	return &wetrpc.ShopClearResponse{
		Success: true,
		Message: "清除成功",
	}, nil
}
